package com.incar.chuxing.utils.Dialogs;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.incar.chuxing.R;


public class LoginStatusDialog extends Dialog {

    private Button yes;//确定按钮
    private Button no;//取消按钮
    private TextView titleTv;//消息标题文本
    private TextView messageTv;//消息提示文本
    private String titleStr;//从外界设置的title文本
    private String messageStr;//从外界设置的消息文本
    private View line;
    //确定文本和取消文本的显示内容
    private String yesStr, noStr, moneyStr;
    private int layoutId;
    private boolean isSingleButton;
    private TextView tv_message;
    private ImageView iv_status;
    private int resouce;


    public LoginStatusDialog(Context context) {
        super(context, R.style.LoginDialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_layout_loginstatus);
        //按空白处不能取消动画
        setCanceledOnTouchOutside(false);
        setCancelable(false);
        //初始化界面控件
        initView();
        //初始化界面数据
        initData();
        //初始化界面控件的事件
        initEvent();

    }

    /**
     * 初始化界面的确定和取消监听器
     */
    private void initEvent() {

    }

    /**
     * 初始化界面控件的显示数据
     */
    private void initData() {

    }

    /**
     * 初始化界面控件
     */
    private void initView() {
        tv_message = (TextView) findViewById(R.id.tv_message);
        iv_status = (ImageView) findViewById(R.id.iv_status);
        if (messageStr != null) {
            tv_message.setText(messageStr);
        }
        if (resouce != 0) {
            iv_status.setImageResource(resouce);
        }

    }


    /**
     * 从外界Activity为Dialog设置dialog的message
     *
     * @param message
     */
    public void setMessage(String message) {
        messageStr = message;
    }

    public void setImageView(int resouce) {
        resouce = resouce;
    }


    public void setSingleButton(Boolean isSingleButton) {
        this.isSingleButton = isSingleButton;
    }

}
